//bool, ObjList objs, str OUT reasonText

Building this;
str name;
this = objs[0].AsBuilding();

if (.IsValid()){
	if (.settlement.IsVillage()) // when anuy village house is damages
	{
		ObjList olBuildings;
		Building b;
		int i;                

		olBuildings = .settlement.Buildings();
		for (i=0; i<olBuildings.count();i+=1)
		{
			b = olBuildings[i];
			if (!b.IsValid()) continue;
			if (b.IsBroken() && b.IsVeryBroken() && .settlement.population<GetConst("MinPopulation"))
			return false;	
		}
	}
         
	if(.IsHeirOf("BaseTavern")){
		name = cmdparam;
		if (.settlement.supplied.IsValid() && name == "tribute"){
			return false;
		} else if (!.settlement.supplied.IsValid() && name == "stoptribute"){
			return false;
		}
	}
}
return true;
